﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using WPFExcelReport.Helpers;
using System.ComponentModel;
using System.Windows.Controls;
namespace WPFExcelReport
{
    public partial class TWS15
    {
        public TWS15()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VWASTAMM();
            this.DataContext = MV;
            InitializeComponent(); 
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
        }
        public override void EditCommand(object sender, RoutedEventArgs e)
        {
            base.EditCommand(sender, e);
        }
        public override void SaveCommand(object sender, RoutedEventArgs e)
        {
            if (dwMaster == null)
                return;
            TMV.UpdateWASTAMM(dwMaster, app.company, 0);
            IsEdit = false;
            IsKEY = false;
            IsSaved = true;
            //base.SaveCommand(sender, e);
        }
        public override void OnEXAUFChg(string vlaue)
        {
            TBMain.Clear();
            if (EXAUF.Length < 23)
                return;
            PM["WART"] = EXAUF.Substring(1, 22);
            SResult = TMV.LOADWS(PM);
            MergeData(SResult, true);
            base.OnEXAUFChg(vlaue);
        }
    }
}
